import axios from 'axios';
import queryString from 'querystring';


let api = {
  getVersionList: '/api-active/v1/api/app/versions',
  getHistoryList: '/api-active/v1/api/app/versions/history/paging',
  getVersionDetail: '/api-active/v1/api/app/versions',
  updateVersionDetail: '/api-active/v1/api/app/version'
}

const getVersionList = (params) => {
  return axios.get(api.getVersionList, params)
}

const getHistoryList = (params) => {
  return axios.get(api.getHistoryList + '/' + params.channel + '/' + params.phoneType + '?orderBy=' + params.orderBy + '&xsc=' + params.xsc + '&pageSize=' + params.pageSize + '&curPage=' + params.curPage)
}

const getVersionDetail = (params) => {
  return axios.get(api.getVersionDetail + '/' + params.id)
}

const updateVersionDetail = (params) => {
  return axios.post(api.updateVersionDetail + '/' + params.channel + '/' + params.phoneType, params)
}

export {
  api,
  getVersionList,
  getHistoryList,
  getVersionDetail,
  updateVersionDetail
}
